home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.11 Nov 91 / TPose Source / UCharacterDialog.p < prev    next >
Encoding:
Text File  |  1991-05-23  |  20.4 KB  |  694 lines  |  [TEXT/MPS ]

  1. {************************************************************************************
  2. UCharacterDialog.p
  3. ************************************************************************************}
  4.  
  5. UNIT UCharacterDialog;
  6.  
  7. INTERFACE
  8.  
  9. USES
  10.     { • MacApp }
  11.     UMacApp,
  12.     
  13.     { • Building Blocks }
  14.     UGridView,
  15.     UTEView,
  16.     UDialog,
  17.     
  18.     UMenuItemCommand;
  19.     
  20. CONST
  21.     kMaxFonds            = 100;            { Max number of FONDs the FontList holds }
  22.     
  23.     kNormalSpacing        =   0;            { values for TSpaceCluster }        { keystroke (UKeywordDialog) }
  24.         
  25.     { TextStyle mode constants — see IM v5 p269 (TESetStyle()) }
  26.     doAlign                        =  64;                { modify alignment }
  27.     doPlusFace                    = 128;                { add face to existing face }
  28.     doMinusFace                    = 256;                { subtract face from existing face }
  29.     doAllAndAlign                = doAll + doAlign;    { doAll, and align too }
  30.     
  31.     { DoChoice() message numbers }
  32.     mFontChanged                = 101;                { Character Dialog }
  33.     mFontSizeChanged            = 102;
  34.     mFontFaceChanged            = 103;
  35.     mTextJustChanged            = 104;
  36.     mTextFontSizeChanged        = 105;
  37.     mListFontSizeChanged        = 106;
  38.     mSpacingChanged                = 107;
  39.  
  40.     {###########################################################################
  41.     Unit Initialization
  42.     ###########################################################################}
  43.     
  44.     PROCEDURE InitUCharacterDialog;
  45.     
  46.  
  47.     {###########################################################################
  48.     Utility Routines
  49.     ###########################################################################}
  50.         
  51.     FUNCTION  SameRGBColor(color1, color2: RGBColor): BOOLEAN;
  52.     FUNCTION  SameTextStyle(style1, style2: TextStyle): BOOLEAN;
  53.  
  54.     { AffectTextStyle(): Uses the given source TextStyle to modify the
  55.       given target TextStyle according to the given mode, in a manner
  56.       similar to that used in TTEView.SetOneStyle().  Note that
  57.       "mode" may include flags for setting the alignment, as defined
  58.       above; if present, they are ignored. }
  59.     PROCEDURE AffectTextStyle(
  60.                             theMode:        INTEGER;
  61.                         VAR    source:            TextStyle;    { not changed }
  62.                         VAR    target:            TextStyle);
  63.  
  64.     { AffectTextAlignment(): Uses the given source  alignment to modify
  65.       the given target alignment according to the given mode, in a
  66.       manner similar to that used in TTEView.SetOneStyle().  Note that
  67.       "mode" may include flags for setting the alignment, as defined
  68.       above. }
  69.     PROCEDURE AffectTextAlignment(
  70.                             theMode:        INTEGER;
  71.                             source:            INTEGER;
  72.                         VAR    target:            INTEGER);
  73.  
  74.     { AffectTextStyleAndAlign(): Uses the given source TextStyle and
  75.       alignment to modify the given target TextStyle and alignment
  76.       according to the given mode, in a manner similar to that used in
  77.       TTEView.SetOneStyle().  Note that "mode" may include flags for
  78.       setting the alignment, as defined above. }
  79.     PROCEDURE AffectTextStyleAndAlign(
  80.                             theMode:        INTEGER;
  81.                         VAR    sourceTS:        TextStyle;    { not changed }
  82.                             sourceAlign:    INTEGER;
  83.                         VAR    targetTS:        TextStyle;
  84.                         VAR    targetAlign:    INTEGER);
  85.  
  86. TYPE
  87.     FontList            = ARRAY [1..kMaxFonds] OF INTEGER; { FOND resource IDs }
  88.     FontListPtr         = ^FontList;
  89.     
  90.  
  91.     {###############################################################################
  92.     TCharDialogView
  93.         This dialog accepts a TextStyle and an alignment, allows the user to edit
  94.         them, and allows access to the result.
  95.     ###############################################################################}
  96.  
  97.     TCharDialogView        = OBJECT (TDialogView)
  98.         fSampleText:    TSampleText;
  99.         fFontListView:    TFontListView;
  100.         fSizeCluster:    TSizeCluster;
  101.         fJustCluster:    TJustifyCluster;
  102.         fFaceCluster:    TFaceCluster;
  103.         
  104.         { PostRes(): Initialize the dialog's subview references. }
  105.         PROCEDURE TCharDialogView.PostRes;
  106.                                 OVERRIDE;
  107.         
  108.         { SetDialogInfo(): Initializes the dialog to reflect the given TextStyle
  109.           record and alignment value. }
  110.         PROCEDURE TCharDialogView.SetDialogInfo(
  111.                                 theStyle:            TextStyle;
  112.                                 alignment:            INTEGER;
  113.                                 redraw:                BOOLEAN);
  114.         
  115.         { GetDialogInfo(): Returns the dialog's current TextStyle record and
  116.           alignment value. }
  117.         PROCEDURE TCharDialogView.GetDialogInfo(
  118.                             VAR    theStyle:            TextStyle;
  119.                             VAR    alignment:            INTEGER);
  120.                                 
  121.         PROCEDURE TCharDialogView.SetTextFont(
  122.                                 theFont:            INTEGER;
  123.                                 redraw:                BOOLEAN);
  124.         
  125.         PROCEDURE TCharDialogView.SetTextSize(
  126.                                 theSize:            INTEGER;
  127.                                 redraw:                BOOLEAN);
  128.         
  129.         PROCEDURE TCharDialogView.SetTextFace(
  130.                                 theFace:            Style;
  131.                                 redraw:                BOOLEAN);
  132.         
  133.         PROCEDURE TCharDialogView.SetTextColor(
  134.                                 theColor:            RGBColor;
  135.                                 redraw:                BOOLEAN);
  136.         
  137.         PROCEDURE TCharDialogView.SetTextJust(
  138.                                 alignment:            INTEGER;
  139.                                 redraw:                BOOLEAN);
  140.  
  141.         PROCEDURE TCharDialogView.DoChoice(
  142.                                 origView:            TView;
  143.                                 itsChoice:            INTEGER);
  144.                                 OVERRIDE;
  145.         END;  { TCharDialogView }
  146.  
  147.             
  148.     {###############################################################################
  149.     TSampleText
  150.         TCharDialogView doesn't need an fTextStyle or an fAlignment field, because
  151.         TSampleText has them.
  152.     ###############################################################################}
  153.  
  154.     TSampleText        = OBJECT (TStaticText)
  155.         { PostRes(): Turn on fAutoWrap (FALSE by default in MacApp 2.0). }
  156.         PROCEDURE TSampleText.PostRes;
  157.                                 OVERRIDE;
  158.         
  159.         PROCEDURE TSampleText.GetTextInfo(
  160.                             VAR    theStyle:            TextStyle;
  161.                             VAR    alignment:            INTEGER);
  162.                             
  163.         PROCEDURE TSampleText.GetTextStyle(
  164.                             VAR    theStyle:            TextStyle);
  165.                                 
  166.         PROCEDURE TSampleText.SetTextStyle(
  167.                                 mode:                INTEGER;    { IM v5 p269 }
  168.                                 theTextStyle:         TextStyle;
  169.                                 redraw:             BOOLEAN);
  170.                                 
  171.         PROCEDURE TSampleText.SetTextFont(
  172.                                 theFont:            INTEGER;
  173.                                 redraw:                BOOLEAN);
  174.         
  175.         PROCEDURE TSampleText.SetTextSize(
  176.                                 theSize:            INTEGER;
  177.                                 redraw:                BOOLEAN);
  178.         
  179.         PROCEDURE TSampleText.SetTextFace(
  180.                                 theFace:            Style;
  181.                                 redraw:                BOOLEAN);
  182.         
  183.         PROCEDURE TSampleText.SetTextColor(
  184.                                 theColor:            RGBColor;
  185.                                 redraw:                BOOLEAN);
  186.         
  187.         PROCEDURE TSampleText.SetTextJust(
  188.                                 alignment:            INTEGER;
  189.                                 redraw:                BOOLEAN);
  190.         END;  { TSampleText }
  191.     
  192.     
  193.     
  194.     {###############################################################################
  195.     TValueCheckBox
  196.         A TValueCheckBox is just like a normal checkbox, except that it has one
  197.         additional field: fNumber.  This value is read in from the view's view
  198.         resource, and can be accessed via access functions.  It is used when the
  199.         control is placed in a TSetCluster.
  200.     ###############################################################################}
  201.     
  202.     ValueCheckBoxTemplatePtr    = ^ValueCheckBoxTemplate;
  203.     ValueCheckBoxTemplate        = RECORD
  204.         number:        INTEGER;
  205.     END;  { ValueCheckBoxTemplate }
  206.     
  207.     TValueCheckBox = OBJECT(TCheckBox)
  208.         fNumber:                INTEGER;
  209.         
  210.         PROCEDURE TValueCheckBox.IRes(
  211.                                 itsDocument:    TDocument;
  212.                                 itsSuperView:    TView;
  213.                             VAR itsParams:        Ptr);
  214.                                 OVERRIDE;
  215.         
  216.         PROCEDURE TValueCheckBox.SetNumber(
  217.                                 number:            INTEGER);
  218.         
  219.         FUNCTION  TValueCheckBox.GetNumber
  220.                                 :INTEGER;
  221.                                 
  222.         { debugger stuff }
  223.         {$IFC qInspector}
  224.         PROCEDURE TValueCheckBox.Fields(
  225.                                 PROCEDURE DoToField(
  226.                                     fieldName:        Str255;
  227.                                     fieldAddr:        Ptr;
  228.                                     fieldType:        INTEGER));
  229.                                 OVERRIDE;
  230.         {$ENDC qInspector}
  231.     END;  { TValueCheckBox }
  232.     
  233.     
  234.     
  235.     {###############################################################################
  236.     TValueRadio
  237.         A TValueRadio is just like a normal radio button, except that it has one
  238.         additional field: fNumber.  This value is read in from the view's view
  239.         resource, and can be accessed via access functions.  It is used when the
  240.         control is placed in a TSetCluster.
  241.         
  242.         This class is actually a minor variation on TValueCheckbox.
  243.     ###############################################################################}
  244.     
  245.     ValueRadioTemplatePtr    = ^ValueRadioTemplate;
  246.     ValueRadioTemplate    = RECORD
  247.         number:        INTEGER;
  248.     END;  { ValueRadioTemplate }
  249.     
  250.     TValueRadio = OBJECT(TRadio)
  251.         fNumber:                INTEGER;
  252.         
  253.         PROCEDURE TValueRadio.IRes(
  254.                                 itsDocument:    TDocument;
  255.                                 itsSuperView:    TView;
  256.                             VAR itsParams:        Ptr);
  257.                                 OVERRIDE;
  258.         
  259.         PROCEDURE TValueRadio.SetNumber(
  260.                                 number:            INTEGER);
  261.         
  262.         FUNCTION  TValueRadio.GetNumber
  263.                                 :INTEGER;
  264.                                 
  265.         { debugger stuff }
  266.         {$IFC qInspector}
  267.         PROCEDURE TValueRadio.Fields(
  268.                                 PROCEDURE DoToField(
  269.                                     fieldName:        Str255;
  270.                                     fieldAddr:        Ptr;
  271.                                     fieldType:        INTEGER));
  272.                                 OVERRIDE;
  273.         {$ENDC qInspector}
  274.     END;  { TValueRadio }
  275.     
  276.     
  277.     {###############################################################################
  278.     TSetCluster
  279.         This class is used to manipulate a group of radio buttons and/or checkbixes
  280.         that, together, define a set of possible values.  For example, one could
  281.         easily imagine a group of seven checkboxes, each repreenting a day of the
  282.         week.  This class can be used to combine the values of that group of
  283.         checkboxes into a set.
  284.         
  285.         It is assumed that the checkboxes and/or radio buttons which are the
  286.         subviews of this class of clusters will be of class TValueCheckBox and
  287.         TValueRadio, respectively (see above).
  288.         
  289.         This class is implemented to act on a small set — no more than 31 possible
  290.         values.  That is because that's enough for a lot of uses, and beacuse its
  291.         the biggest set for which there are no performance penalties (see MPW 3.0
  292.         Pascal manual, p.4-18: Set Types).
  293.         
  294.         Note:  This implementation could be improved by adding two additional
  295.         fields:  fMinValue and fMaxValue.  These values could be used for
  296.         boundary checks in DoChoice(), instead of kMinValue and kMaxValue.
  297.         
  298.         Also note that fSet is not initialized during PostRes(), so that it can be
  299.         set with a call to SetTheSet() without redundancy.  However, the set is
  300.         initialized to the empty set ([]) during IRes(), to ensure stability.
  301.     ###############################################################################}
  302.  
  303. CONST
  304.     kMinValue        =         0;
  305.     kMaxValue        =        30;
  306.     kBadValue        =    -32768;
  307.     kEmptySet        =        -1;
  308.     
  309. TYPE
  310.     ValueRange        =    kMinValue..kMaxValue;
  311.     ValueSet        =    SET OF ValueRange;
  312.  
  313.     TSetCluster = OBJECT(TCluster)
  314.         fSet:                    ValueSet;    { the current set }
  315.         
  316.         { IRes(): Sets fSet to []. }
  317.         PROCEDURE TSetCluster.IRes(
  318.                                 itsDocument:    TDocument;
  319.                                 itsSuperView:    TView;
  320.                             VAR itsParams:        Ptr);
  321.                                 OVERRIDE;
  322.         
  323.         PROCEDURE TSetCluster.SetTheSet(
  324.                                 theSet:            ValueSet;
  325.                                 redraw:            BOOLEAN);
  326.         
  327.         FUNCTION TSetCluster.GetTheSet
  328.                                 : ValueSet;
  329.         
  330.         { DoCheckBoxHit(): Handles mCheckBoxHit messages.  Can alter the
  331.           values of origView and itsChoice. }
  332.         PROCEDURE TSetCluster.DoCheckBoxHit(
  333.                             VAR    origView:        TView;
  334.                             VAR    itsChoice:        INTEGER);
  335.         
  336.         { DoRadioHit(): Handles mRadioHit messages.  Can alter the values
  337.           of origView and itsChoice. }
  338.         PROCEDURE TSetCluster.DoRadioHit(
  339.                             VAR    origView:        TView;
  340.                             VAR    itsChoice:        INTEGER);
  341.         
  342.         { DoChoice(): maintains fSet. }
  343.         PROCEDURE TSetCluster.DoChoice(
  344.                                 origView:        TView;
  345.                                 itsChoice:        INTEGER);
  346.                                 OVERRIDE;
  347.                                 
  348.         { debugger stuff }
  349.         {$IFC qInspector}
  350.         PROCEDURE TSetCluster.Fields(
  351.                                 PROCEDURE DoToField(
  352.                                     fieldName:        Str255;
  353.                                     fieldAddr:        Ptr;
  354.                                     fieldType:        INTEGER));
  355.                                 OVERRIDE;
  356.         {$ENDC qInspector}
  357.     END;  { TSetCluster }
  358.     
  359.     
  360.     
  361.     {###############################################################################
  362.     TValueRadioCluster
  363.         This class is, in most respects, just like a regular cluster.  Its special
  364.         function is that, if it contains a bunch of TValueRadio controls, it
  365.         can find the 'number' of the currently-selected TValueRadio control. 
  366.     ###############################################################################}
  367.     
  368.     TValueRadioCluster = OBJECT(TCluster)
  369.         PROCEDURE TValueRadioCluster.SetNumber(
  370.                                 number:            INTEGER;
  371.                                 redraw:            BOOLEAN);
  372.                                 
  373.         FUNCTION  TValueRadioCluster.GetNumber
  374.                                 :INTEGER;
  375.                                 
  376.         { debugger stuff }
  377.         {$IFC qInspector}
  378.         PROCEDURE TValueRadioCluster.Fields(
  379.                                 PROCEDURE DoToField(
  380.                                     fieldName:        Str255;
  381.                                     fieldAddr:        Ptr;
  382.                                     fieldType:        INTEGER));
  383.                                 OVERRIDE;
  384.         {$ENDC qInspector}
  385.     END;  { TValueRadioCluster }
  386.  
  387.             
  388.     {###############################################################################
  389.     TJustifyCluster
  390.     ###############################################################################}
  391.     
  392.     TJustifyCluster        = OBJECT (TValueRadioCluster)
  393.         fSampleText:    TSampleText;
  394.         
  395.         { PostRes(): Initialize the dialog's subview references. }
  396.         PROCEDURE TJustifyCluster.PostRes;
  397.                                 OVERRIDE;
  398.         
  399.         PROCEDURE TJustifyCluster.DoChoice(
  400.                                 origView:            TView;
  401.                                 itsChoice:            INTEGER);
  402.                                 OVERRIDE;
  403.         
  404.         PROCEDURE TJustifyCluster.SetTextJust(
  405.                                 alignment:            INTEGER;
  406.                                 redraw:                BOOLEAN);
  407.         END;  { TJustifyCluster }
  408.  
  409.     {###############################################################################
  410.     TStyleCluster
  411.         This class provides an interface between the TFaceCluster class, which
  412.         wants to manipulate QuickDraw styles, and TSetCluster, which wants to
  413.         manipulate ValueSets (see IM v1 p201).
  414.     ###############################################################################}
  415.  
  416.     TStyleCluster        = OBJECT (TSetCluster)
  417.         PROCEDURE TStyleCluster.SetTextFace(
  418.                                 theFace:            Style;
  419.                                 redraw:                BOOLEAN);
  420.         
  421.         FUNCTION  TStyleCluster.GetTextFace
  422.                                 : Style;
  423.         END;
  424.  
  425.     {###############################################################################
  426.     TSpaceCluster
  427.         This class provides an interface between the TFaceCluster class, which
  428.         wants to manipulate QuickDraw styles, and TValueRadioCluster, which wants
  429.         to manipulate only single integers.
  430.     ###############################################################################}
  431.  
  432.     TSpaceCluster        = OBJECT (TValueRadioCluster)
  433.         PROCEDURE TSpaceCluster.SetTextFace(
  434.                                 theFace:            Style;
  435.                                 redraw:                BOOLEAN);
  436.         
  437.         FUNCTION  TSpaceCluster.GetTextFace
  438.                                 : Style;
  439.         END;  { TSpaceCluster }
  440.     
  441.  
  442.     {###############################################################################
  443.     TFaceCluster
  444.         This implementation relies on these facts being true:
  445.             • all of the controls in the TStyleCluster are checkboxes
  446.             • all of the controls in the TSpaceCluster are radio buttons
  447.             • the TFaceCluster contains no other controls
  448.             
  449.         With these things being true, we know that whenever the TFaceCluster's
  450.         DoChoice() method gets told about a mCheckBoxHit, we know it happened in
  451.         the style cluster.  Likewise, if it gets a mRadioHit message, we know
  452.         it happened in the TSpaceCluster.
  453.     ###############################################################################}
  454.  
  455.     TFaceCluster        = OBJECT (TCluster)
  456.         fStyleCluster:        TStyleCluster;
  457.         fSpaceCluster:        TSpaceCluster;
  458.         fSampleText:        TSampleText;
  459.         
  460.         { PostRes(): Initialize the dialog's subview references. }
  461.         PROCEDURE TFaceCluster.PostRes;
  462.                                 OVERRIDE;
  463.         
  464.         PROCEDURE TFaceCluster.SetTextFace(
  465.                                 theFace:            Style;
  466.                                 redraw:                BOOLEAN);
  467.         
  468.         FUNCTION  TFaceCluster.GetTextFace
  469.                                 : Style;
  470.  
  471.         { DoChoice():  Handles all manipulations of the style and spacing
  472.           clusters, which are subviews of SELF. }
  473.         PROCEDURE TFaceCluster.DoChoice(
  474.                                 origView:             TView;
  475.                                 itsChoice:             INTEGER);
  476.                                 OVERRIDE;
  477.         END;
  478.  
  479.  
  480.     {###############################################################################
  481.     TFontListView
  482.     ###############################################################################}
  483.  
  484.     TFontListView        = OBJECT (TTextListView)
  485.         fFontList:            FontListPtr;        { font resource ids }
  486.         
  487.         { PostRes(): Calls InitFontList(). }
  488.         PROCEDURE TFontListView.PostRes;
  489.                                 OVERRIDE;
  490.  
  491.         PROCEDURE TFontListView.InitFontList;
  492.  
  493.         PROCEDURE TFontListView.Free;
  494.                                 OVERRIDE;
  495.  
  496.         PROCEDURE TFontListView.GetItemText(
  497.                                 anItem:                INTEGER;
  498.                                 VAR aString:         Str255);
  499.                                 OVERRIDE;
  500.  
  501.         PROCEDURE TFontListView.SelectItem(
  502.                                 anItem:             INTEGER;
  503.                                 extendSelection,
  504.                                 highlight,
  505.                                 select:             BOOLEAN);
  506.                                 OVERRIDE;
  507.  
  508.         FUNCTION TFontListView.GetTextFont
  509.                                 :INTEGER;
  510.  
  511.         PROCEDURE TFontListView.SetTextFont(
  512.                                 theFont:            INTEGER;
  513.                                 redraw:                BOOLEAN);
  514.         
  515.         {$IFC qInspector}
  516.         PROCEDURE TFontListView.Fields(PROCEDURE
  517.                                      DoToField(fieldName: Str255;
  518.                                                fieldAddr: Ptr;
  519.                                                fieldType: INTEGER)); OVERRIDE;
  520.         {$ENDC qInspector}
  521.         END;
  522.  
  523.  
  524.    {###############################################################################
  525.     TSizeListView
  526.     ###############################################################################}
  527.  
  528.     TSizeListView        = OBJECT (TTextListView)
  529.  
  530.         fFondID:        INTEGER;
  531.  
  532.         FUNCTION TSizeListView.GetItemSize(
  533.                                 anItem:             INTEGER)
  534.                                 :INTEGER;
  535.  
  536.         FUNCTION TSizeListView.FindSizeItem(
  537.                                 theSize:             INTEGER)
  538.                                 :INTEGER;
  539.  
  540.         FUNCTION TSizeListView.GetTextSize
  541.                                 :INTEGER;
  542.  
  543.         PROCEDURE TSizeListView.SetTextSize(
  544.                                 theSize:            INTEGER;
  545.                                 redraw:                BOOLEAN);
  546.  
  547.         PROCEDURE TSizeListView.GetItemText(
  548.                                 anItem:             INTEGER;
  549.                                 VAR aString:         Str255);
  550.                                 OVERRIDE;
  551.  
  552.         PROCEDURE TSizeListView.SetNumberOfItems(
  553.                                 aNumber:             INTEGER);
  554.  
  555.         PROCEDURE TSizeListView.InstallFontFamily(
  556.                                 theFondID:             INTEGER);
  557.  
  558.         PROCEDURE TSizeListView.SelectItem(
  559.                                 anItem:             INTEGER;
  560.                                 extendSelection:     BOOLEAN;
  561.                                 highlight:             BOOLEAN;
  562.                                 select:             BOOLEAN);
  563.                                 OVERRIDE;
  564.  
  565.         PROCEDURE TSizeListView.Fields(PROCEDURE
  566.                                      DoToField(fieldName: Str255;
  567.                                                fieldAddr: Ptr;
  568.                                                fieldType: INTEGER)); OVERRIDE;
  569.         END;
  570.         
  571.         
  572.     {###############################################################################
  573.     TSizeText
  574.     ###############################################################################}
  575.     
  576.     TSizeText        = OBJECT (TNumberText)
  577.  
  578.         FUNCTION TSizeText.GetTextSize
  579.                                 :INTEGER;
  580.  
  581.         PROCEDURE TSizeText.SetTextSize(
  582.                                 theSize:            INTEGER;
  583.                                 redraw:                BOOLEAN);
  584.         
  585.         FUNCTION TSizeText.Validate: LONGINT;
  586.                                 OVERRIDE;
  587.                                 
  588.         END;
  589.  
  590.  
  591.     {###############################################################################
  592.     TSizeCluster
  593.     ###############################################################################}
  594.  
  595.     TSizeCluster        = OBJECT (TCluster)
  596.         fSizeText:            TSizeText;
  597.         fSizeListView:        TSizeListView;
  598.         
  599.         { PostRes(): Initialize the dialog's subview references. }
  600.         PROCEDURE TSizeCluster.PostRes;
  601.                                 OVERRIDE;
  602.  
  603.         FUNCTION  TSizeCluster.GetTextSize
  604.                                 :INTEGER;
  605.  
  606.         PROCEDURE TSizeCluster.SetTextSize(
  607.                                 theSize:            INTEGER;
  608.                                 redraw:                BOOLEAN);
  609.         
  610.         PROCEDURE TSizeCluster.SetTextFont(
  611.                                 theFont:            INTEGER;
  612.                                 redraw:                BOOLEAN);
  613.         
  614.         PROCEDURE TSizeCluster.DoChoice(
  615.                                 origView:             TView;
  616.                                 itsChoice:             INTEGER);
  617.                                 OVERRIDE;
  618.         END;
  619.  
  620.  
  621.     {###########################################################################
  622.     TCharacterDialogCmd
  623.         This command displays the Character dialog.  It is a subclass of
  624.         TMacAppDialogCmd, which is defined in UMenuItemCommand.
  625.     ###########################################################################}
  626.     
  627.     TCharacterDialogCmd        = OBJECT(TMacAppDialogCmd)
  628.         fTextStyle:            TextStyle;
  629.         fAlignment:            INTEGER;
  630.         
  631.         PROCEDURE TCharacterDialogCmd.ICharacterDialogCmd(
  632.                                 itsCmdNumber:        CmdNumber;
  633.                                 itsDocument:        TDocument;
  634.                                 itsView:            TView;
  635.                                 itsScroller:        TScroller;
  636.                                 itsTextStyle:        TextStyle;
  637.                                 itsAlignment:        INTEGER);
  638.         
  639.         { InitTheDialog(): Initializes the dialog to reflect the command's
  640.           TextStyle and alignment values (which were set in an override of
  641.           InitMenuItemCommand()). }
  642.         PROCEDURE TCharacterDialogCmd.InitTheDialog;
  643.                                 OVERRIDE;
  644.                         
  645.         {$IFC qInspector}
  646.         PROCEDURE TCharacterDialogCmd.Fields(
  647.                                 PROCEDURE DoToField(
  648.                                     fieldName:        Str255;
  649.                                     fieldAddr:        Ptr;
  650.                                     fieldType:        INTEGER));
  651.                                 OVERRIDE;
  652.         {$ENDC qInspector}
  653.         END;  { TCharacterDialogCmd }
  654.     
  655.     
  656.     {###########################################################################
  657.     TColorDialogCmd
  658.         This command displays the Color Picker dialog.
  659.     ###########################################################################}
  660.     
  661.     TColorDialogCmd        = OBJECT(TToolboxDialogCmd)
  662.         fInitialColor:        RGBColor;
  663.         fResultColor:        RGBColor;
  664.         fPromptID:            INTEGER;
  665.         
  666.         PROCEDURE TColorDialogCmd.IColorDialogCmd(
  667.                                 itsCmdNumber:        CmdNumber;
  668.                                 itsDocument:        TDocument;
  669.                                 itsView:            TView;
  670.                                 itsScroller:        TScroller;
  671.                                 itsInitialColor:    RGBColor;
  672.                                 itsPromptID:        INTEGER);
  673.         
  674.         { PoseTheDialog(): Calls the Color Picker Package routine GetColor(),
  675.           which builds its own dialog, using its own filter, dismissers, etc. }
  676.         PROCEDURE TColorDialogCmd.PoseTheDialog;
  677.                                 OVERRIDE;
  678.         
  679.         {$IFC qInspector}
  680.         PROCEDURE TColorDialogCmd.Fields(
  681.                                 PROCEDURE DoToField(
  682.                                     fieldName:        Str255;
  683.                                     fieldAddr:        Ptr;
  684.                                     fieldType:        INTEGER));
  685.                                 OVERRIDE;
  686.         {$ENDC qInspector}
  687.         END;  { TColorDialogCmd }
  688.  
  689.             
  690. IMPLEMENTATION
  691.  
  692. {$I UCharacterDialog.inc1.p}
  693.  
  694. END.